
jBGallery.Keys = function(engine, shortcuts){
  var _init = false;
    function _onkeydown(e){
        var _keycode = e.which || e.keyCode;
        switch(_keycode){
            case shortcuts[0]:
                engine.left();
                return false;
            break;
            case shortcuts[1]:
                engine.right();
               return false;
            break;
            case 37:
            case 38:
            case 39:
            case 40:
                return false;
            break;
        }
    }
    function _bind(){
    
     if (!_init && engine.length() > 1) {
           $(document).bind("keydown.jbgallery", _onkeydown);
       _init = true;
     }  
  }
  //MAIN
  _bind();
  
  //API
  return {
    notify : function(){
       _bind(); 
    }
  }
};
